package map;
import java.util.HashMap;
import java.util.Map;
/**
 *
 */
public class MapDemo1 {
    public static void main(String[] args) {
        Map<String, Integer> map =new HashMap<>();
        Integer value = map.put("语文",150);
        System.out.println(value);
        map.put("数学",149);
        map.put("英语",149);
        map.put("物理",98);
        map.put("历史",99);
        map.put("化学",100);
        System.out.println(map);
        value =map.put("语文",130);
        System.out.println(value);
        System.out.println(map);
        value =map.get("语文");
        System.out.println(value);
        value =map.get("体育");
        System.out.println(value);
        int size =map.size();
        System.out.println("size："+size);
        value =map.remove("数学");
        System.out.println(value);
        System.out.println(map);
        //判断包含的标准仍然是靠equals方法进行的
        boolean isEmpty =map.isEmpty();
        System.out.println("isEmpty："+isEmpty);
        boolean ck =map.containsKey("英语");
        System.out.println("containsKey："+ck);
        boolean cv =map.containsValue(20);
        System.out.println("containsValue："+cv);
        map.clear();
        System.out.println(map);
    }
}